<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>手机小电 爆款品质</title>
    <link rel="stylesheet" href="../../css/model.css">
    <style>
        * {
            padding: 0;
            margin: 0;
        }

        ul,
        ol {
            list-style: none;
        }

        a {
            text-decoration: none;
        }

        html,
        body {
            height: 100%;
        }

        .ctx{
            background: url('../images/bkjd-1009/bg01.jpg')no-repeat center 0, url('../images/bkjd-1009/bg02.jpg')no-repeat center 334px;
            background-color: #4186DE;
            padding-bottom: 60px;
        }
        .clearfix:after,
        .clearfix:before {
            content: ". ";
            display: block;
            clear: both;
            visibility: hidden;
            line-height: 0;
            height: 0;
            font-size: 0;
        }

        .clearfix {
            *zoom: 1;
        }

        .fl {
            float: left;
        }

        .fr {
            float: right;
        }

        .ml0 {
            margin-left: 0 !important;
        }

        .hiden {
            display: none;
        }

        .wrap {
            width: 1001px;
            margin: 0 auto;
            padding-top: 700px;
        }

        .container ol {
            position: relative;
            width: 480px;
            height: 57px;
            margin: 10px auto;
            border-radius: 57px;
            background-color: #2469BF;
        }

        .container ol li {
            position: absolute;
            transition: .5s;
            height: 100%;
            width: 135px;
            border-radius: 57px;
            top: 0;
            text-align: center;
            line-height: 57px;
            color: white;
            font-size: 20px;
            font-weight: bold;
            cursor: pointer;
        }

        .container ol .title-1 {
            left: 0;
        }

        .container ol .title-2 {
            right: 0;
        }

        .container ol li.t-cur {
            width: 345px;
            background-color: #FCD827;
            font-size: 28px;
            font-weight: bold;
            color: #E11F0B;
        }

        .container .tab-list {
            position: relative;
        }

        .container ul {
            width: 100%;
            /* position: absolute; */
        }

        .container ul li {
            position: relative;
            width: 327px;
            height: 444px;
            background-color: white;
            margin-left: 10px;
            margin-top: 10px;
            transition: .3s;
            text-align: center;
        }

        .container ul li:nth-child(1),
        .container ul li:nth-child(4),
        .container ul li:nth-child(7),
        .container ul li:nth-child(10),
        .container ul li:nth-child(13),
        .container ul li:nth-child(16) {
            margin-left: 0;
        }

        .container ul li:hover {
            transform: translateY(-6px);
            box-shadow: 0px 0px 18px rgba(0, 12, 50, 0.3);
        }

        .container ul li a {
            display: block;
            background-color: deeppink;
            height: 318px;
            width: 100%;
        }

        .container ul li img {
            width: 100%;
            height: 100%;
        }

        .container ul li p {
            padding: 6px 12px;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }

        .price {
            font-size: 14px;
            color: #A6A6A6;
        }

        .price>span {
            color: #F13F34;
            font-size: 16px;
        }

        .price>span span {
            font-size: 26px;
            font-weight: bold;
        }

        .container ul li .buy-now {
            display: block;
            margin: 10px auto;
            width: 158px;
            height: 28px;
            color: white;
            line-height: 28px;
            border-radius: 4px;
            background-color: #E01222;
            cursor: pointer;
        }

        .back-top {
            width: 179px;
            height: 71px;
            background: url('../images/bkjd-1009/top.png')no-repeat center/100% 100%;
            margin: 60px auto 0;
            cursor: pointer;
        }
    </style>
</head>

<body>
    <div id="tp_box"></div>
    <div class="ctx">
            <div class="wrap ">
                    <div class="container ">
                        <ol>
                            <li class="title-1 t-cur ">
                                <p>小家电</p>
                            </li>
                            <li class="title-2 ">
                                <p>手机数码</p>
                            </li>
                        </ol>
                        <div class="tab-list">
                        </div>
                    </div>
                </div>
                <div class="back-top "></div>
    </div>
    <div id="ft_box"></div>
    <!-- template -->
    <script type="text/html" id="ctn-tpl">
        {{each $data}}
        <ul class="clearfix {{$index!=0?'hiden':''}}">
            {{each $value.infoId}}
            <li class="fl">
            </li>
            {{/each}}
        </ul>
        {{/each}}
    </script>
    <script type="text/html" id="card-tpl">
        <a href="{{href}}" target='_blank'>
            <img src="{{pic}}" alt=" ">
        </a>
        <p>{{name}}</p>
        <div class="price ">原价：
            <del>{{price_on_tag}}元</del>&nbsp;&nbsp;&nbsp;
            <span>购买价:
                <span>{{discountPrice}}</span>元</span>
        </div>
        <a class="buy-now" href='{{href}}' target='_blank'>
            立即购买
        </a>
    </script>
</body>
<script src="../../js/jquery-1.8.3.min.js "></script>
<script src="../../js/art-template.js"></script>
<script src="../../js/model.js "></script>
<script src="../../js/login.js"></script>
<script>
    var WWW_URL = 'http://www.cjwsc.com';
    $("#tp_box").topBox();
    $("#ft_box").footBox();
    (function ($, template) {
        var info = [{
                name: '小家电',
                infoId: [121480, 51189, 147040, 93750, 147618, 99521, 111101, 122246, 126442, 143820, 143791,
                    139042, 113317, 125556, 135332, 109302, 100294, 99506
                ]
            },
            {
                name: '手机数码',
                infoId: [142187, 142185, 142244, 137760, 133937, 147675, 109563, 111927, 113845, 136602, 114256,
                    138970
                ]
            }
        ];

        $('.tab-list').html(template('ctn-tpl', info))

        function getData(idx, _idx, id) {
            $.ajax({
                url: 'http://www.cjwsc.com/qcwdProduct/getProductByIds',
                data: {
                    ids: id,
                    business_type: 10,
                    client_type: 1
                },
                dataType: "jsonp",
                jsonp: 'jsonpcallback',
                success: function (res) {
                    res.msg[0].href = 'http://www.cjwsc.com/item/' + id + '.html';
                    res.msg[0].pic = res.msg[0].pic.replace('240_240', '800_800')
                    $('.tab-list ul').eq(idx).find('li').eq(_idx).html(template('card-tpl', res.msg[0]))
                }
            })
        }

        for (var i = 0; i < info.length; i++) {
            for (var j = 0; j < info[i].infoId.length; j++) {
                getData(i, j, info[i].infoId[j]);
            }
        }

        $('.container ol').on('click', 'li', function (e) {
            var $this = $(this);
            $this.addClass('t-cur').siblings().removeClass('t-cur');
            $('.container ul').eq($this.index()).fadeIn().siblings().fadeOut();
        })

        $('.back-top').on('click', function () {
            $('html,body').animate({
                scrollTop: 0
            }, 300);
        })
    }($, template))
</script>

</html>